{
 "cells": [
  {
   "cell_type": "markdown",
   "id": "d38b9982-7208-45ad-b3ce-a4ac24900d3a",
   "metadata": {},
   "source": [
    "Chapter 07\n",
    "# if...elif...else语句\n",
    "Book_1《编程不难》 | 鸢尾花书：从加减乘除到机器学习 "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "4873e6e4-ee7e-43e4-b079-e6c21b045b6a",
   "metadata": {},
   "outputs": [],
   "source": [
    "num = input('输入一个整数')\n",
    "num = int(num)\n",
    "\n",
    "if num > 0:\n",
    "    print(\"num is positive\")\n",
    "\n",
    "elif num < 0:\n",
    "    print(\"num is negative\")\n",
    "\n",
    "else:\n",
    "    print(\"num is zero\")"
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3 (ipykernel)",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.10.9"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 5
}
